<extend name="_Layout/maintwo"/>
<block name="style">
    <style>
        .lbw_btn_margin{
            margin-top: 3% !important;
        }
        .lbw_btn_a_margin{
            height: 85px !important;
        }
        .lbw_btn_color_one{
            color: #FFF;
            font-weight: bold;
            background-color: #44CDAF;
        }
        .lbw_btn_color_two{
            color: #FFF;
            font-weight: bold;
            background-color: #2646A1;
        }
        .lbw_btn_p_{
            font-size: 8px;
            color: #FFF;
            margin-left: 12px;
        }
        .lbw_header_bz{
            color: #FFF !important;
            font-weight: bold !important;
            background-color: #00B630 !important;
        }
        .lbw_header_bztwo{
            color: #FFF !important;
            font-weight: bold !important;
            background-color: #2646A1 !important;
        }
        .btn-default:hover, .btn-default:focus, .btn-default.focus, .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default{
            color: #FFF;
            background-color: #F19307;
            border-color: #F19307;
        }
        .lbw_plist_mx{
            margin-top: 20px;
        }

        .lbw_plist_li{
            background-color: #FFF;
            border-left: none !important;
            border-right: none !important;
            color: #656565;
            border-radius: 0px !important;
            font-weight: bold;
        }
        .lbw_pdlist_sjx {
            width: 50px;
            position: relative;
            top: -6px;
            right: -10px;
        }
        .lbw_table_tr{
            background-color: #d9534f;
            color: #FFF;
        }
    </style>
</block>
<block name="main">
    <div class="row lbw_plist_mx">
        <div class="col-md-6">

            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading lbw_header_bz">密码修改</div>
                <div style="padding: 20px;">
                    <form action="{:U('Home/User/restOnePwd')}" method="post" class="form reset-form-mobile">
                        <fieldset>
                            <div class="blank"></div>
                            <div class="form-group">
                                <label class="control-label">手機號<span class="check-tips"></span></label>
                                <div class="control">
                                    <input type="text" class="form-control" name="mobile" placeholder="請輸入手機號">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label">驗證碼<span class="check-tips"></span></label>
                                <div class="input-group">
                                    <input type="text" class="form-control" name="verify" placeholder="請輸入驗證碼">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default send-mobile-verify">發送短信驗證碼</button>
                                            </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label">新密碼<span class="check-tips"></span></label>
                                <div class="control">
                                    <input type="text" class="form-control" name="password" placeholder="請輸入新密碼">
                                </div>
                            </div>
                            <div class="form-group">
                                <input type="hidden" name="reg_type" value="mobile">
                                <button style="background-color:#00B630 !important;border:none !important; " class="btn btn-danger btn-block ajax-post"  type="submit" target-form="reset-form-mobile">重置密碼</button>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
            <div class="col-md-12">
                <div class="panel panel-default">
                    <!-- Default panel contents -->
                    <div class="panel-heading lbw_header_bz">二级密码修改</div>
                    <div style="padding: 20px;">
                        <form action="{:U('Home/User/restTwoPwd')}" method="post" class="form reset-form-mobile">
                            <fieldset>
                                <div class="blank"></div>
                                <div class="form-group">
                                    <label class="control-label">手機號<span class="check-tips"></span></label>
                                    <div class="control">
                                        <input type="text" class="form-control" name="mobiletwo" placeholder="請輸入手機號">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label">驗證碼<span class="check-tips"></span></label>
                                    <div class="input-group">
                                        <input type="text" class="form-control" name="verify" placeholder="請輸入驗證碼">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default send-mobile-verifytwo">發送短信驗證碼</button>
                                            </span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label">新二级密碼<span class="check-tips"></span></label>
                                    <div class="control">
                                        <input type="text" class="form-control" name="lbw_twopwd" placeholder="請輸入新密碼">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <input type="hidden" name="reg_type" value="mobile">
                                    <button  style="background-color:#00B630 !important;border:none !important; " class="btn btn-danger btn-block ajax-post"  type="submit" target-form="reset-form-mobile">重置密碼</button>
                                </div>
                            </fieldset>
                        </form>
                    </div>
                    </div>
            </div>
        </div>
        <div class="col-md-6">

            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading lbw_header_bz">賬戶信息</div>
                <ul class="list-group">
                    <volist name="lbwlistt" id="ab">
                    <li class="list-group-item"><b>用戶名: {$ab.username}</b></li>
                    <li class="list-group-item"><b>手機號: {$ab.mobile}</b></li>
                    <li class="list-group-item"><b>等級: <if condition="$asf.lbw_viplevel eq 0">V1<elseif condition="$asf.lbw_viplevel eq 1"/>V2<elseif condition="$asf.lbw_viplevel eq 2"/>V3<elseif condition="$asf.lbw_viplevel eq 3"/>V4<else /></if></b></li>
                    <li class="list-group-item"><b>動態錢包: {$user_dt_ye}</b></li>
                    <li class="list-group-item"><b>真實姓名: {$ab.realname}</b></li>
                    <li class="list-group-item"><b>身份號碼: {$ab.idcard_no}</b></li>
                    <li class="list-group-item"><b>直推總數: {$ab.lbw_zhitui}</b></li>
                    <li class="list-group-item"><b>推薦人姓名: {$usename_name}</b></li>
                    <li class="list-group-item"><b>推薦人用戶名: {$usename_tjr}</b></li>
                    <li class="list-group-item"><b>推薦人電話: {$tjrmb}</b></li>
                    <li class="list-group-item"><b>排單總數: {$ab.lbw_paidancount}</b></li>
                    <li class="list-group-item"><b>利息總數: {$ab.lbw_lixitotal}</b></li>
                    <li class="list-group-item"><b>銀行名稱: <b id="OrderTime">{$ab.lbw_bankname}</b></b>
                    <input  style="float: right;background-color:#00B630;color: #FFF;border-color: #00B630;border-radius: 2px;" id="changeOrderTime" type="button" value="修改" onclick="changeOrderTime()"/>
                    <button class="btn btn-danger" style="display:none" onclick="timeChange()" id="timeChangeOK">确定</button>
                    </li>
                    <li class="list-group-item"><b>銀行卡號:<b id="OrderTimet"> {$ab.lbw_banknumber}</b></b>
                    <input style="float: right;background-color:#00B630;color: #FFF;border-color: #00B630;border-radius: 2px;" id="changeOrderTimetwo" type="button" value="修改" onclick="changeOrderTimettwo()"/>
                    <button class="btn btn-danger"style="display:none" onclick="timeChangetwo()" id="timeChangetwoOK">确定</button>
                    </li>
                    <li class="list-group-item"><b>支付寶號:<b id="OrderTimef">  {$ab.lbw_alipay}</b></b>
                    <input style="float: right;background-color:#00B630;color: #FFF;border-color: #00B630;border-radius: 2px;" id="changeOrderTimethree" type="button" value="修改" onclick="changeOrderTimefthree()"/>
                    <button class="btn btn-danger" style="display:none" onclick="timeChangethree()" id="timeChangethreeOK">确定</button>
                    </li>
                    </volist>
                </ul>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function(){
            //發送驗證碼倒計時
            function time(that, wait){
                if(wait == 0){
                    $(that).removeClass('disabled').prop('disabled',false);
                    $(that).html('重新發送驗證碼');
                }else{
                    $(that).html(wait+'秒後重新發送');
                    wait--;
                    setTimeout(function(){
                        time(that, wait);
                    }, 1000);
                }
            }

            $('.send-mobile-verify').click(function(){
                var url;
                var that = this;
                if(url = "{:U('Home/User/restMobileVerify')}"){
                    var mobile = $('input[name="mobile"]').val();
                    var filter  = /^1\d{10}$/;
                    if(!filter.test(mobile)){
                        alert('手機號碼不正確');
                        $(that).addClass('disabled').prop('disabled', true);
                        time(that, 5);
                    }else{
                        $(that).addClass('disabled').prop('disabled', true);
                        time(that, 30);
                        $.post(url,{'mobile':mobile, 'title':'用戶注冊'}).success(function(data){
                            if(data.status == 1){
                                alert(data.info);
                            }else{
                                alert(data.info);
                            }
                        });
                    }
                }
                return false;
            });

            $('.send-mobile-verifytwo').click(function(){
                var url;
                var that = this;
                if(url = "{:U('Home/User/restMobileVerify')}"){
                    var mobile = $('input[name="mobiletwo"]').val();
                    var filter  = /^1\d{10}$/;
                    if(!filter.test(mobile)){
                        alert('手機號碼不正確');
                        $(that).addClass('disabled').prop('disabled', true);
                        time(that, 5);
                    }else{
                        $(that).addClass('disabled').prop('disabled', true);
                        time(that, 60);
                        $.post(url,{'mobile':mobile, 'title':'用戶注冊'}).success(function(data){
                            if(data.status == 1){
                                alert(data.info);
                            }else{
                                alert(data.info);
                            }
                        });
                    }
                }
                return false;
            });
        });
    </script>
    <script type="text/javascript">
        function changeOrderTime(){
            document.getElementById('timeChangeOK').style.display='block';
            document.getElementById('changeOrderTime').style.display='none';
            var o = document.getElementById("OrderTime");
            var c = o.innerHTML;
            o.innerHTML = "<input class='form-control' id='oneedit' type='text' value='" + c + "'/>"
        }
        function changeOrderTimettwo(){
            document.getElementById('timeChangetwoOK').style.display='block';
            document.getElementById('changeOrderTimetwo').style.display='none';
            var o = document.getElementById("OrderTimet");
            var c = o.innerHTML;
            o.innerHTML = "<input class='form-control' id='oneedittwo' type='text' value='" + c + "'/>"
        }
        function changeOrderTimefthree(){
            document.getElementById('timeChangethreeOK').style.display='block';
            document.getElementById('changeOrderTimethree').style.display='none';
            var o = document.getElementById("OrderTimef");
            var c = o.innerHTML;
            o.innerHTML = "<input class='form-control' id='oneeditthree' type='text' value='" + c + "'/>"
        }

        function timeChange(){
                var abcd =$("#oneedit").val();
                var ajaxdata = "&bank_name="+abcd;
                $.ajax({
                    type: "post",
                    url : "{:U('Home/User/editUserInfo')}",
                    data: ajaxdata,
                    success: function(response){
                        alert(response);
                    }
                });
            document.getElementById('timeChangeOK').style.display='none';
            document.getElementById('changeOrderTime').style.display='block';
            var o = document.getElementById("OrderTime");
            o.innerHTML = "{$ab.lbw_bankname}"
        }

        function timeChangetwo(){
            var abcd =$("#oneedittwo").val();
            var ajaxdata = "&bank_number="+abcd;
            $.ajax({
                type: "post",
                url : "{:U('Home/User/editUserInfo')}",
                data: ajaxdata,
                success: function(response){
                    alert(response);
                }
            });
            document.getElementById('timeChangetwoOK').style.display='none';
            document.getElementById('changeOrderTimetwo').style.display='block';
            var o = document.getElementById("OrderTimet");
            o.innerHTML = "{$ab.lbw_banknumber}"
        }

        function timeChangethree(){
            var abcd =$("#oneeditthree").val();
            var ajaxdata = "&alipay="+abcd;
            $.ajax({
                type: "post",
                url : "{:U('Home/User/editUserInfo')}",
                data: ajaxdata,
                success: function(response){
                    alert(response);
                }
            });
            document.getElementById('timeChangethreeOK').style.display='none';
            document.getElementById('changeOrderTimethree').style.display='block';
            var o = document.getElementById("OrderTimef");
            o.innerHTML = "{$ab.lbw_alipay}"
        }
    </script>
</block>